//
//  RBResponse.m
//  Culture
//
//  Created by Lan on 2017/9/8.
//  Copyright © 2017年 SummerTea. All rights reserved.
//

#import "RBResponse.h"

@implementation RBResponse

+ (NSDictionary *)modelCustomPropertyMapper
{
    NSDictionary *dic = @{
                          @"message" : @[@"msg", @"error_msg", @"message"],
                          @"code": @[@"status_code", @"error_code", @"code"],
                          };
    NSMutableDictionary *dicM = [NSMutableDictionary dictionaryWithDictionary:dic];
    [dicM addEntriesFromDictionary:[self rbRenameKeyDic]];
    return dicM;
}

+ (NSDictionary *)modelContainerPropertyGenericClass
{
    return [self rbAssignClassDic];
}

+ (NSDictionary *)rbRenameKeyDic
{
    return nil;
}

+ (NSDictionary *)rbAssignClassDic
{
    return nil;
}

- (BOOL)succeed
{
    return self.code == 200;
}

- (NSInteger)nextPage
{
    return self.currentPage + 1;
}

- (BOOL)hasNextPage
{
    return self.totalPage > self.currentPage;
}

@end
